package com.taysear.parcel.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
public class Loadingsheet implements Serializable{

	private static final long serialVersionUID = -620948444516745114L;

	@Id @Column(name="loadingsheet_id") @GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer loadingsheetId;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="route")
	private Route route;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="origin", insertable=true, updatable=false)
	private Substation origin;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="destination", insertable=true, updatable=false)
	private Substation destination;
	@Column(name="load_date")
	@Temporal(TemporalType.TIMESTAMP)
	private Date loadDate;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="bus_id")
	private Bus bus;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="driver", insertable=true, updatable=false)
	private Employee driver;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="conductor", insertable=true, updatable=false)
	private Employee conductor;
	@ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="loadingsheet_status_id")
	private LoadingsheetStatus loadingsheetStatus;
	
	public Integer getLoadingsheetId() {
		return loadingsheetId;
	}
	public void setLoadingsheetId(Integer loadingsheetId) {
		this.loadingsheetId = loadingsheetId;
	}
	public Substation getOrigin() {
		return origin;
	}
	public void setOrigin(Substation origin) {
		this.origin = origin;
	}
	public Substation getDestination() {
		return destination;
	}
	public void setDestination(Substation destination) {
		this.destination = destination;
	}
	public Date getLoadDate() {
		return loadDate;
	}
	public void setLoadDate(Date loadDate) {
		this.loadDate = loadDate;
	}
	public Bus getBus() {
		return bus;
	}
	public void setBus(Bus bus) {
		this.bus = bus;
	}
	public Employee getDriver() {
		return driver;
	}
	public void setDriver(Employee driver) {
		this.driver = driver;
	}
	public Employee getConductor() {
		return conductor;
	}
	public void setConductor(Employee conductor) {
		this.conductor = conductor;
	}
	public LoadingsheetStatus getLoadingsheetStatus() {
		return loadingsheetStatus;
	}
	public void setLoadingsheetStatus(LoadingsheetStatus loadingsheetStatus) {
		this.loadingsheetStatus = loadingsheetStatus;
	}
	public Route getRoute() {
		return route;
	}
	public void setRoute(Route route) {
		this.route = route;
	}
	
}
